try:
	import gtk
	import gobject
	import psyco
except:
	import sys
	print 'Need psyco, gobject and gtk.'
	sys.exit(1)

#from thread import start_new_thread

def gtk_lock_required(f):
#	def new_f(*args):
#		gtk.gdk.threads_enter()
#		try:
#			f(*args)
#		except:
#			pass
#		gtk.gdk.threads_leave()

	def start_f(*args):
#		start_new_thread(new_f, (args))
		gobject.idle_add(f, *args)

	return start_f

def with_psyco(f):
	g = psyco.proxy(f)
	return g
